<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('info', function (Blueprint $table) {
            $table->increments('id')->comment('自增ID');
            $table->unsignedInteger('info_category_id')->default('0')->comment('栏目分类ID');
            $table->unsignedInteger('info_model_id')->default('0')->comment('模型ID');
            $table->string('title', 100)->default('')->comment('标题');
            $table->string('subtitle', 50)->default('')->comment('短标题');
            $table->string('keywords', 500)->default('')->comment('关键词');
            $table->string('description', 200)->default('')->comment('描述');
            $table->unsignedInteger('cover_image')->default('0')->comment('封面图');
            $table->string('href', 100)->default('')->comment('链接地址');
            $table->string('href_target', 20)->default('_blank')->comment('打开方式');
            $table->string('rel', 20)->default('')->comment('链接关系XFN，数据来源数据字典');
            $table->unsignedInteger('hits')->default('1')->comment('浏览量');
            $table->string('recommend_type', 50)->default('')->comment('推荐类型，复选框，数据字典');
            $table->unsignedTinyInteger('top')->default('0')->comment('是否置顶：1不置顶，2置顶');
            $table->unsignedInteger('sort')->default('999')->comment('排序位置');
            $table->tinyInteger('status')->default(1)->comment('发布状态，0未发布，1已发布 ，数据字典');
            $table->unsignedInteger('created_user_id')->default('0')->comment('管理员ID');
            $table->timestamp('created_at')->nullable()->comment('创建时间');
            $table->timestamp('updated_at')->nullable()->comment('更新时间');
            $table->softDeletes()->comment('删除时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('info');
    }
}
